package cn.myfirefly.moming.common.model;

import java.io.Serializable;

public class MenuDto implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -4730353959523148132L;
	private String id;
	private String pId;
	private String name;
	//菜单地址
	private String url;
	
	//用于排序
	private Integer funIndex;
	
	private String openIcon;
	private String closeIcon;
	
	/**
	 * 递归级别，递归时可根据这个值限制递归次数，避免死循环
	 */
	private int recursiveLevel = 0;
	
	public String getOpenIcon() {
		return openIcon;
	}
	public void setOpenIcon(String openIcon) {
		this.openIcon = openIcon;
	}
	public String getCloseIcon() {
		return closeIcon;
	}
	public void setCloseIcon(String closeIcon) {
		this.closeIcon = closeIcon;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getpId() {
		return pId;
	}
	public void setPId(String pId) {
		this.pId = pId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getFunIndex() {
		return funIndex;
	}
	public void setFunIndex(Integer funIndex) {
		this.funIndex = funIndex;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((closeIcon == null) ? 0 : closeIcon.hashCode());
		result = prime * result
				+ ((funIndex == null) ? 0 : funIndex.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result
				+ ((openIcon == null) ? 0 : openIcon.hashCode());
		result = prime * result + ((pId == null) ? 0 : pId.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MenuDto other = (MenuDto) obj;
		if (closeIcon == null) {
			if (other.closeIcon != null)
				return false;
		} else if (!closeIcon.equals(other.closeIcon))
			return false;
		if (funIndex == null) {
			if (other.funIndex != null)
				return false;
		} else if (!funIndex.equals(other.funIndex))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (openIcon == null) {
			if (other.openIcon != null)
				return false;
		} else if (!openIcon.equals(other.openIcon))
			return false;
		if (pId == null) {
			if (other.pId != null)
				return false;
		} else if (!pId.equals(other.pId))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}
	public int getRecursiveLevel() {
		return recursiveLevel;
	}
	public void setRecursiveLevel(int recursiveLevel) {
		this.recursiveLevel = recursiveLevel;
	}
	
}
